//
//  LRXMoreThingTableViewTitleView.m
//  路人侠
//
//  Created by zhangxulong on 3/7/16.
//  Copyright © 2016 zhangxulong. All rights reserved.
//

#import "LRXMoreThingTableViewTitleView.h"

@implementation LRXMoreThingTableViewTitleView
- (instancetype)initTitleView
{
    if (self = [super init]) {
        UILabel * nameLabel = [[UILabel alloc]init];
        UILabel * priceLabel = [[UILabel alloc]init];
        UILabel * countLabel = [[UILabel alloc]init];
        nameLabel.text = @"物品"; priceLabel.text = @"单价"; countLabel.text = @"数量";
        nameLabel.font = [UIFont systemFontOfSize:27 * hScale];
        countLabel.font = priceLabel.font = nameLabel.font;
        
        CGFloat minX = 50 * wScale;
        nameLabel.frame = CGRectMake(minX, 16 * hScale, 0, 0);
        countLabel.frame = CGRectMake(MainScreenW - 130 * wScale -  minX,16 * hScale,0,0);
        
        [priceLabel sizeToFit];
        CGFloat wordW = priceLabel.frame.size.width * 0.5;
        priceLabel.frame = CGRectMake((MainScreenW - 100 * wScale) * 0.5 - wordW, 16 * hScale, 0, 0);
        [nameLabel sizeToFit];
        [priceLabel sizeToFit];
        [countLabel sizeToFit];
        
        
 
        
        
        
        [self addSubview:nameLabel]; [self addSubview:countLabel]; [self addSubview:priceLabel];
    }
    return self;
}
+ (instancetype)layoutTitleView
{
    return [[LRXMoreThingTableViewTitleView alloc]initTitleView];
}
@end
